/**
 * @file
 * @brief header of (module)
 * @details
 *  \b purpose
 * 
 * @author buaa.byl
 * @date 2012-07-24 created
 */

#ifndef SXML_NODE_H_11F5CE40_D54F_11E1_B358_005056C00008_INCLUDED_
#define SXML_NODE_H_11F5CE40_D54F_11E1_B358_005056C00008_INCLUDED_

/* ************************************************************************* */
/*              include files                                                */
/* ************************************************************************* */


/* ************************************************************************* */
/*              C linkage declaration (begin)                                */
/* ************************************************************************* */
#if defined(__cplusplus)
extern "C"
{
#endif


/* ************************************************************************* */
/*              declare of module type or struct                             */
/* ************************************************************************* */
struct _sxmlAttr
{
    char* name;
    char* value;

    struct _sxmlNode* parent;
    struct _sxmlAttr* next;
    struct _sxmlAttr* prev;
};

struct _sxmlNode
{
    char* name;
    char* value;
    int level;

    struct _sxmlNode* children;
    struct _sxmlNode* parent;
    struct _sxmlNode* next;
    struct _sxmlNode* prev;

    struct _sxmlAttr* properties;
};

/* ************************************************************************* */
/*              declare of module interface                                  */
/* ************************************************************************* */
void sxmlWalkAttr(struct _sxmlAttr* p);
void sxmlWalkNode(struct _sxmlNode* p);
void sxmlFreeAttr(struct _sxmlAttr* p);
void sxmlFreeNode(struct _sxmlNode* p);
struct _sxmlNode* sxmlGetRootElement(const char* xmlfile);
const char* sxmlNodeGetContent(struct _sxmlNode* p);
int sxmlHasProp(struct _sxmlNode* p, const char* name);
const char* sxmlGetProp(struct _sxmlNode* p, const char* name);


/* ************************************************************************* */
/*              C linkage declaration (end)                                  */
/* ************************************************************************* */
#if defined(__cplusplus)
}
#endif


#endif

